package com.lqjava.flowable.beans.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 第三方登录枚举
 * 主要功能: 区分登录类型
 * @author lq 2021年3月21日 18:35:33
 */
@Getter
@AllArgsConstructor
public enum ThirdLoginTypeEnum {

	DINGTALK(1,"钉钉"),
	WECHAT(2,"微信"),
	;
	private Integer value;//值
	private String explain;//说明
	
	private static final Map<Integer, ThirdLoginTypeEnum> KMAP = Arrays.stream(values()).collect(Collectors.toMap(ThirdLoginTypeEnum::getValue,e -> e));

	public static ThirdLoginTypeEnum get(Integer code){
		return KMAP.get(code);
	}
}
